传奇之家 - 传奇开区一条龙服务网站

当前位置:传奇之家 > 开区脚本 > > 详细页面

巴克攻城战 · 行会争夺系统

巴克攻城战 · 行会争夺系统

巴克攻城战 · 行会争夺系统

作者:传奇之家类别:开区脚本

更新:2026-10-29查看次数:53

功能说明:? 模拟沙巴克攻城,记录攻城时间、参与行会、获胜方,并触发全服公告。
// 沙巴克攻城战脚本
program ShaBaKeSiege;
 
const
  SIEGE_DURATION = 120; // 攻城持续时间(分钟)
  MAX_GUILDS = 10;
 
type
  TGuild = record
    Name: string;
    Score: Integer;
    Leader: string;
  end;
 
var
  Guilds: array[1..MAX_GUILDS] of TGuild;
  SiegeActive: Boolean;
  Winner: string;
 
procedure StartSiege;
var
  i: Integer;
begin
  SiegeActive := True;
  Writeln('═════════════════════════════════');
  Writeln('   ???? 沙巴克攻城战正式开始!');
  Writeln('   持续时间:', SIEGE_DURATION, '分钟');
  Writeln('═════════════════════════════════');
  
  // 初始化行会数据
  for i := 1 to MAX_GUILDS do
  begin
    Guilds[i].Name := '行会_' + IntToStr(i);
    Guilds[i].Score := 0;
    Guilds[i].Leader := '未知';
  end;
  
  Guilds[1].Name := '战神殿'; Guilds[1].Leader := '战天';
  Guilds[2].Name := '血色黄昏'; Guilds[2].Leader := '血影';
  Guilds[3].Name := '龙腾九州'; Guilds[3].Leader := '龙哥';
end;
 
procedure BattleLoop;
var
  i, Tick: Integer;
begin
  Tick := 0;
  while SiegeActive and (Tick < SIEGE_DURATION) do
  begin
    Inc(Tick);
    // 模拟战斗积分
    for i := 1 to 3 do
      Guilds[i].Score := Guilds[i].Score + Random(50) + 10;
    
    if Tick mod 30 = 0 then
    begin
      Writeln('[', Tick, '分钟] 当前战况:');
      Writeln('  ', Guilds[1].Name, ' 积分:', Guilds[1].Score);
      Writeln('  ', Guilds[2].Name, ' 积分:', Guilds[2].Score);
      Writeln('  ', Guilds[3].Name, ' 积分:', Guilds[3].Score);
    end;
    
    Sleep(1000); // 模拟时间流逝
  end;
end;
 
procedure EndSiege;
var
  i, MaxScore, WinnerIdx: Integer;
begin
  SiegeActive := False;
  MaxScore := -1;
  WinnerIdx := 0;
  
  for i := 1 to 3 do
    if Guilds[i].Score > MaxScore then
    begin
      MaxScore := Guilds[i].Score;
      WinnerIdx := i;
    end;
  
  Winner := Guilds[WinnerIdx].Name;
  Writeln('');
  Writeln('???????????? 攻城战结束!????????????');
  Writeln('   获胜行会:', Winner);
  Writeln('   会长:', Guilds[WinnerIdx].Leader);
  Writeln('   总积分:', MaxScore);
  Writeln('   全服公告:恭喜「', Winner, '」占领沙巴克!');
end;
 
begin
  Randomize;
  StartSiege;
  BattleLoop;
  EndSiege;
end.